const express = require('express');
const path = require('path');
require('./db/connection');
const {port} = require('./config/config');
const modal = require('./db/model');
const Log  = modal.get('log');
const app = express();

app.get('/p.gif', (req, res) => {
    const data = req.query;
    if (data.content) {
        data.content = JSON.parse(data.content);
    }
    Log.create(data).then((result) =>{
        res.send('ok');
    });
});

app.listen(port, () => {
    console.log(`server run in ${port} port...`);
});
